﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace XmlMerge.Interfaces
{
    public interface IXmlOperator
    {
        /// <summary>
        /// Removes entries that from target xml that also appear in the source xml.
        /// </summary>
        /// <param name="target">Entries will be removed from this root xml</param>
        /// <param name="source">Entries will be searched from this root xml</param>
        /// <returns></returns>
        bool RemoveDuplicateEntries(XElement target, XElement source);

        /// <summary>
        /// Removes nodes in the xml that do not have any descendants.
        /// </summary>
        /// <param name="table">The xml to remove nodes from</param>
        /// <returns></returns>
        bool RemoveChildlessEntries(XElement target);

        /// <summary>
        /// Adds Entries from the from the source XElement not present in the target
        /// </summary>
        /// <param name="target">The DataTable that will be updated</param>
        /// <param name="source">The DataTable to be merged</param>
        /// <returns></returns>
        bool AddNewEntries(XElement target, XElement source);

        /// <summary>
        /// Removes nodes not present in the source from the target.
        /// </summary>
        /// <param name="target">the target XElement</param>
        /// <param name="source">the source XElement</param>
        /// <returns></returns>
        bool RemoveSubtractedEntries(XElement target, XElement source);
    }
}
